<template>
	<view class="selectService">
		<view class="top">
			<image :src="data.productPic" mode="scaleToFill"></image>
			<view class="rightBox">
				<view class="title">
					{{data.productName}}
				</view>
				<view class="desction">
					{{data.productAttr}}
				</view>
			</view>
		</view>
		<view class="box">
			<view @tap="goRefund(1)">
				<view class="left">
					<view class="title">
						我要退款（无需退货）
					</view>
					<view class="desction">
						没收到货，或已收到货后与卖家协商同意不用退货只退款
					</view>
				</view>
				<image src="../../static/images/more_icon.png" mode="scaleToFill"></image>
			</view>
			<view @tap="goRefund(2)">
				<view class="left">
					<view class="title">
						我要退货退款
					</view>
					<view class="desction">
						已收到货，需要退还收到的货物       
					</view>
				</view>
				<image src="../../static/images/more_icon.png" mode="scaleToFill"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data() {
			return {
				data: {}
			}
		},
		onLoad(e) {
			this.data = JSON.parse(decodeURIComponent(e.data))
		},
		methods:{
			goRefund(type){
				uni.navigateTo({
					url:"../refund/refund?type="+type+"&data=" + encodeURIComponent(JSON.stringify(this.data))
				})
			}
		}
	}
</script>

<style lang="scss">
	.selectService{
		min-height: 100vh;
		padding-top: 20upx;
		box-sizing: border-box;
		.top{
			background-color: #fff;
			border-radius: 20upx;
			padding: 20upx;
			box-sizing: border-box;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			image{
				width: 140upx;
				height: 140upx;
				margin-right: 20upx;
			}
			.rightBox{
				width: 530upx;
				.title{
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
					color: #333;
					font-size: 28upx;
				}
				.desction{
					color: #808080;
					font-size: 22upx;
					display: -webkit-box;
					overflow: hidden; 
					white-space: normal!important;
					text-overflow: ellipsis;
					word-wrap: break-word; 
					-webkit-line-clamp: 2;
					-webkit-box-orient: vertical;
				}
			}
			
		}
		.box{
			&>view{
				display: flex;
				align-items: center;
				justify-content: space-between;
				height: 118upx;
				border-bottom: 1upx solid #f2f2f2;
				padding: 0 28upx;
				box-sizing: border-box;
			}
			.left{
				.title{
					font-size: 28upx;
					color: #333;
				}
				.desction{
					font-size: 22upx;
					color: #808080;
				}
			}
			image{
				width: 22upx;
				height: 22upx;
			}
			
		}
		
	}
</style>
